<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>doh.robot dialog focus destroy Test</title>

		<style>
			@import "../../../util/doh/robot/robot.css";
		</style>

		<!-- required: dojo.js -->
		<script type="text/javascript" src="../../../dojo/dojo.js"
			djConfig="isDebug: true"></script>

		<script type="text/javascript">
			dojo.require("dijit.robotx");

			dojo.addOnLoad(function(){
				doh.robot.initRobot('../test_Dialog_focusDestroy.html');
					
				doh.register("TestDestroy",[
					{
						name: "destroy",
						timeout: 11000,
						runTest: function(){
							var d = new doh.Deferred();

							doh.robot.mouseMoveAt("testInput", 500);
							doh.robot.mouseClick({left:true}, 500);
							doh.robot.keyPress(dojo.keys.BACKSPACE, 500);
							doh.robot.keyPress(dojo.keys.BACKSPACE, 500);
							doh.robot.keyPress(dojo.keys.BACKSPACE, 500);
							doh.robot.keyPress("a", 1000);
							doh.robot.mouseMoveAt("showDialog", 500);
							doh.robot.mouseClick({left:true}, 500);
							doh.robot.keyPress("a", 1000);
							doh.robot.mouseMoveAt("destroyButton", 500);
							doh.robot.mouseClick({left:true}, 500);
							doh.robot.mouseMoveAt("testInput", 500);
							doh.robot.mouseClick({left:true}, 500);
							doh.robot.keyPress(dojo.keys.BACKSPACE, 500);
							doh.robot.keyPress("b", 1000);
							
							doh.robot.sequence(d.getTestCallback(dojo.hitch(this, function(){
								var inputBox = dojo.byId("testInput");
								doh.is("b", inputBox.value);
							})), 1000);

							return d;
						}
					}
				]);
				doh.run();
			});
		</script>
	</head>
</html>
